<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::CacheStores::Filesystem</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (F)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="CacheStores.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores.html" title="Sass::CacheStores (module)">CacheStores</a></span>
     &raquo; 
    <span class="title">Filesystem</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/CacheStores/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/CacheStores/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::CacheStores::Filesystem 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></li>
          
            <li class="next">Sass::CacheStores::Filesystem</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/cache_stores/filesystem.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A backend for the Sass cache using the filesystem.</p>

  </div>
</div>
<div class="tags">
  
</div>

  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#cache_location-instance_method" title="#cache_location (instance method)">- (String) <strong>cache_location</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The directory where the cached files will be stored.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#_retrieve-instance_method" title="#_retrieve (instance method)">- <strong>_retrieve</strong>(key, version, sha) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#_store-instance_method" title="#_store (instance method)">- <strong>_store</strong>(key, version, sha, contents) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Filesystem) <strong>initialize</strong>(cache_location) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">A new instance of Filesystem.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></h3>
  <p class="inherited"><a href="Base-2.html#key-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#key-instance_method" title="Sass::CacheStores::Base#key (method)">#key</a>, <a href="Base-2.html#retrieve-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#retrieve-instance_method" title="Sass::CacheStores::Base#retrieve (method)">#retrieve</a>, <a href="Base-2.html#store-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#store-instance_method" title="Sass::CacheStores::Base#store (method)">#store</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::CacheStores::Filesystem (class)">Filesystem</a></tt>) <strong>initialize</strong>(cache_location) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of Filesystem</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>cache_location</span>
      
      
      
        &mdash;
        see <tt><a href="#cache_location-instance_method" title="Sass::CacheStores::Filesystem#cache_location (method)">#cache_location</a></tt>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


13
14
15</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/filesystem.rb', line 13</span>

def initialize(cache_location)
  @cache_location = cache_location
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="cache_location=-instance_method"></span>
      <span id="cache_location-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="cache_location-instance_method">
  
    - (<tt>String</tt>) <strong>cache_location</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The directory where the cached files will be stored.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/filesystem.rb', line 10</span>

def cache_location
  @cache_location
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="_retrieve-instance_method">
  
    - <strong>_retrieve</strong>(key, version, sha) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li>Base#\_retrieve</li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20
21
22
23
24
25
26
27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/filesystem.rb', line 18</span>

def _retrieve(key, version, sha)
  return unless File.readable?(path_to(key))
  File.open(path_to(key), "rb") do |f|
    if f.readline("\n").strip == version && f.readline("\n").strip == sha
      return f.read
    end
  end
  File.unlink path_to(key)
  nil
rescue EOFError, TypeError, ArgumentError => e
  Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="_store-instance_method">
  
    - <strong>_store</strong>(key, version, sha, contents) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li>Base#\_store</li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/filesystem.rb', line 32</span>

def _store(key, version, sha, contents)
  # return unless File.writable?(File.dirname(@cache_location))
  # return if File.exists?(@cache_location) && !File.writable?(@cache_location)
  compiled_filename = path_to(key)
  # return if File.exists?(File.dirname(compiled_filename)) && !File.writable?(File.dirname(compiled_filename))
  # return if File.exists?(compiled_filename) && !File.writable?(compiled_filename)
  FileUtils.mkdir_p(File.dirname(compiled_filename))
  File.open(compiled_filename, "wb") do |f|
    f.puts(version)
    f.puts(sha)
    f.write(contents)
  end
rescue Errno::EACCES
  #pass
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:49 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>